package cn.tedu.tmall.admin.mall.controller;


import cn.tedu.tmall.admin.mall.pojo.parm.CategoryAddNewParm;
import cn.tedu.tmall.admin.mall.service.ICategoryService;
import cn.tedu.tmall.common.web.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/categories")
public class CategoryController {

    @Autowired
    ICategoryService categoryService;

    @PostMapping("/add-new")
    public JsonResult addNew(@RequestBody CategoryAddNewParm categoryAddNewParm){
        categoryService.addNew(categoryAddNewParm);
        return JsonResult.ok();
    }

}
